const mysql = require("mysql")
const connection = mysql.createConnection({
     host :"localhost",
     port :3306,
     user :"root",
     password :"root",
     database :"zz0308"
})
connection.connect()

function Query(sqlStr){
    return new Promise((resolve,reject)=>{
      connection.query(sqlStr,(err,result)=>{

     
        if(err){
            reject([err])
        }else{
            resolve([err,result])
        }
   })
})
}

module.exports = Query